{include file="public/header"}
    <script type="text/javascript">
    function countDown(obj,endTime){
        var time_start = new Date().getTime(); //设定当前时间
        var time_end =  parseInt(endTime); //设定目标时间
        // 计算时间差
        var time_distance = time_end - time_start;
        // 天
        var int_day = Math.floor(time_distance/86400000);
        time_distance -= int_day * 86400000;
        // 时
        var int_hour = Math.floor(time_distance/3600000);
        time_distance -= int_hour * 3600000;
        // 分
        var int_minute = Math.floor(time_distance/60000);
        time_distance -= int_minute * 60000;
        // 秒
        var int_second = Math.floor(time_distance/1000);
        // 时分秒为单数时、前面加零
        if(int_day < 10 && int_day > 0){
            int_day = "0" + int_day;
        }else if(int_day < 0){  // 日期已过
            console.log(obj);
            $(obj).text("已到期");//加载数据后，发现已经过期了，没有倒计时的必要
            return false;
        }
        if(int_hour < 10){
            int_hour = "0" + int_hour;
        }
        if(int_minute < 10){
            int_minute = "0" + int_minute;
        }
        if(int_second < 10){
            int_second = "0" + int_second;
        }
        if(int_day<=0 && int_hour<=0 && int_minute <=0 && int_second<=0){
            console.log(obj);
            $(obj).text("已到期");//加载数据后，发现已经过期了，没有倒计时的必要
            return false;
        }
        // 显示时间
        if(int_day>0){
            var result = parseInt(int_day)+"天"+int_hour+"小时"+int_minute+"分"+int_second+'秒';
		}else{
            var result = int_hour+"小时"+int_minute+"分"+int_second+'秒';
		}
        $(obj).text(result);
        // 设置定时器
        setTimeout("countDown("+"'"+obj+"'"+","+endTime+")",1000);
    }
    </script>
<body class="">
<div class="bg_fixed_v10_1"></div>
	<div class="sectionY sectionY_tttt" style="position: inherit">
		<a href="javascript:history.back();">
            <img src="__PUBLIC__/home/images/v10_a9.png" alt="" class="a1">
		</a>
		<p class="p1">
            <span class="ppp_title">转让详情</span>
        </p>
	</div>
<style type='text/css'>
    .agg{
        padding: 10px;
    }
    .agg_1{
        background: url("__PUBLIC__/home/images/v10_a19.png");
        background-size: 100% 100%;
        padding: 0px 15px;
    }
    .xi_section1 .center1 .pp1 .a1{float:none;}
</style>
	<div class="xi_section1">

		<div class="center">
			<ul>
				<div class="agg">
                    <div class="agg_1">
                        <div class="title" style="padding-left: 0;border-bottom: 1px solid #096da3">
                            <p class="p1" style="color: #04c5f0">订单基本信息</p>
                        </div>
                        <li class="clearfix">
                            <span class="s1">类型</span>
                            <span class="s2">{$buyid.title}</span>
                        </li>
                        <li class="clearfix">
                            <span class="s1">应收费用</span>
                            <span class="s2">{$buyid.basicprice}</span>
                        </li>
                        <li class="clearfix">
                            <span class="s1">合约收益</span>
                            <span class="s2">{$buyid.daynum}天/{$buyid.earnpercent}%</span>
                        </li>

                        <li class="clearfix">
                            <span class="s1">消耗共享豆</span>
                            <span class="s2"><span class="s3">{$buyid.caifen}</span>个</span>
                        </li>
                        <li class="clearfix">
                            <span class="s1">我的本单收益</span>
                            <span class="s2">{$buyid.dayaddprice}</span>
                        </li>
                        <li class="clearfix">
                            <span class="s1">抢购时间</span>
                            <span class="s2">{$buyid.ctime|date='Y-m-d H:i:s',###}</span>
                        </li>

                        <li class="clearfix" style="border-bottom: none">
                            <span class="s1">到期时间</span>
                            <span class="s2">{$buyid.cansaletime|date='Y-m-d H:i:s',###}</span>
                        </li>
                    </div>
                </div>
                <?php if($buyid['peiduistatus']==2){ ?>
    				<li class="clearfix">
    					<span class="s1">支付状态</span>
                        {if condition="$buyid['paystatus'] eq 0"}<span class="s2">未付款</span>{/if}
                        {if condition="$buyid['paystatus'] eq 1"}<span class="s2">已付款</span>{/if}
                        {if condition="$buyid['paystatus'] eq 2"}<span class="s2">已完成</span>{/if}
    				</li>
                    <?php if($buyid['paystatus']==0){ ?>
                        <li class="clearfix">
        					<span class="s1">付款剩余时间：</span>
                            <span style='color:red;' class="s2 sred" id='oneTime{$buyid.id}'></span>
                            <?php $recive_time = ($buyid['peiduitime']+config('setting.pay_limit_time')*60); ?>
                            <script>countDown('#oneTime'+{$buyid.id},parseInt({$recive_time}*1000));</script>
        				</li>
                    <?php } ?>
                    <?php if($buyid['paystatus']==1){ ?>
                        <li class="clearfix">
        					<span class="s1">确认收款剩余时间：</span>
                            <span style='color:red;' class="s2 sred" id='oneTime1{$buyid.id}'></span>
                            <?php $recive_time = ($buyid['paytime']+config('setting.pay_limit_time')*60); ?>
                            <script>countDown('#oneTime1'+{$buyid.id},parseInt({$recive_time}*1000));</script>
        				</li>
                    <?php } ?>
                <?php } ?>




			</ul>
		</div>

		<div class="center1" style="padding:0px 0px;">
            <div class="agg">
                <div class="agg_1">
                    <div class="title" style="padding-left: 0px;border-bottom: 1px solid #096da3">
                        <p class="p1">我的收款信息</p>
                    </div>
                    <!--新增联系双方信息-->
                    <div class="pp1 clearfix" style="margin:0;">
                        <div class="a1" style="width: 100%">
                            <p class="p1 clearfix">
                                <span class="s1">用户名：</span>
                                <span class="s2">{$get_man.username}</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">手机号：</span>
                                <span class="s2">{$get_man.selfphone}</span>
                            </p>
							<p class="p1 clearfix">
                                <span class="s1">紧急联系人：</span>
                                <span class="s2">{$get_man.mustman}</span>
                            </p>
                        </div>
                    </div>
                    <?php
            $str = '';
            //echo '<pre>';print_r($get_man);exit;
                    if(empty($get_man['emailname']) || empty($get_man['email']) || empty($get_man['emailcode'])){}else{
                    $str = $str."<option value='支付宝'>支付宝</option>";
                    ?>
                    <div class="pp1 clearfix">
                        <div class="a1 clearfix" style="width: 100%">
                            <p class="p1 clearfix">
                                <span class="s1">账号类型：</span>
                                <span class="s2">支付宝</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">用户姓名：</span>
                                <span class="s2">{$get_man.emailname}</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">支付宝账号：</span>
                                <span class="s2">{$get_man.email}</span>
                            </p>
                        </div>
                        <div class="a2" style="width: 100%;text-align: center">
                            <img src="{$get_man.emailcode}" alt="1" class="show_btn">
                        </div>
                    </div>
                    <?php
        }if(empty($get_man['realname']) || empty($get_man['banktypename']) || empty($get_man['bankname']) || empty($get_man['bankcard']) ){}else{
            $str = $str."<option value='银行卡'>银行卡</option>";
                    ?>

                    <div class="pp1 clearfix">
                        <div class="a1">
                            <p class="p1 clearfix">
                                <span class="s1">账号类型：</span>
                                <span class="s2">银行卡信息</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">用户姓名：</span>
                                <span class="s2">{$get_man.realname}</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">开户银行：</span>
                                <span class="s2">{$get_man.banktypename}</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">开户支行：</span>
                                <span class="s2">{$get_man.bankname}</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">银行卡号：</span>
                                <span class="s2">{$get_man.bankcard}</span>
                            </p>
                        </div>
                    </div>

                    <?php
            }
            if(empty($get_man['selfqqname']) || empty($get_man['selfqq']) || empty($get_man['selfqqcode'])){}else{
                $str = $str."<option value='微信'>微信</option>";
                    ?>

                    <div class="pp1 clearfix">
                        <div class="a1" style="width: 100%">
                            <p class="p1 clearfix">
                                <span class="s1">账号类型：</span>
                                <span class="s2">微信</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">用户姓名：</span>
                                <span class="s2">{$get_man.selfqqname}</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">微信号：</span>
                                <span class="s2">{$get_man.selfqq}</span>
                            </p>
                        </div>
                        <div class="a2" style="width: 100%;text-align: center">
                            <img src="{$get_man.selfqqcode}" alt="2" class="show_btn">
                        </div>
                    </div>


                    <?php
            }
            ?>
                </div>
            </div>
        </div>




            <div class="center1" style="padding: 0px 0px;">
                <div class="agg">
                    <div class="agg_1">
                        <div class="title" style="padding-left: 0px;border-bottom: 1px solid #096da3">
                            <p class="p1">对方付款信息</p>
                        </div>
                        <div class="pp1 clearfix" style="margin:0;">
                            <div class="a1" style="width: 100%">
                                <p class="p1 clearfix">
                                    <span class="s1">用户名：</span>
                                    <span class="s2">{$payman.username|default="无"}</span>
                                </p>
                                <p class="p1 clearfix">
                                    <span class="s1">手机号：</span>
                                    <span class="s2">{$payman.selfphone|default="无"}</span>
                                </p>
								<p class="p1 clearfix">
                                    <span class="s1">紧急联系人：</span>
                                    <span class="s2">{$payman.mustman|default="无"}</span>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 对方付款信息 -->
            <?php if($buyid['paystatus']>0){ ?>

                <div class="center1">
                    <div class="pp1 clearfix">
                        <div class="a1">
                            <p class="p1 clearfix">
                                <span class="s1">付款类型：</span>
                                <span class="s2">{$buyid.paytype}</span>
                            </p>
                            <p class="p1 clearfix">
                                <span class="s1">付款时间：</span>
                                <span class="s2">{$buyid.paytime|date='Y-m-d H:i:s',###}</span>
                            </p>
                        </div>
                        <div class="a2" style="width: 100%;text-align: center">
                            <img src="{$buyid.payimg}" alt="1" class="show_btn">
                        </div>
                    </div>
                </div>
            <?php } ?>

	<div class="zhan" style="height: 60px;"></div>
	<div class="footer_fix">
		<a href="{:url('Rent/transfer')}">返回列表</a>
	</div>
	<div class="big_img">
		<img src="__PUBLIC__/home/images/a5.jpg" alt="">
	</div>
</body>
<script>
	$(function(){
		var d = $(window).height()-46-44;
		$(".zu_section2").css("height",d);
		$(".show_btn").click(function(){
            var altval = $(this).attr('src');
            $(".big_img img").attr('src',altval);
            var dd = $(".big_img").height();
			$(".big_img").show(200);
            $(".big_img img").css("paddingTop",(dd-$(".big_img img").height())/3.5);
		})
		$(".big_img").click(function(){
			$(".big_img").hide(200);
		})
	})
</script>
</html>
